var appData = {};

    $.getAppData = function (name) {
        return appData[name];
    }
    $.setAppData = function (name, value) {
        if (appData[name]) {
            seajs.log("key '" + name + "' 已被覆盖,请注意!", "warn");
        }
        appData[name] = value;
        return appData;
    }
    $.removeAppData = function (keys) {
        keys.forEach(function (k) {
            delete appData[k];
        })
    }

$('.logout').click(function(){
    $.ajax({
        url:'/logout.json',
        type: 'delete',
        contentType:'application/json;charset=UTF-8',
        success: function (data) {
            if (data.stat == 'OK') {
                    location.href = '/index'
            }else{
                $('.err-info').html("登出失败");
            }
        },
        error:function (err) {
            $('.err-info').html("服务器连接失败");
        }
    })
})